import request from '@/utils/request'

export default {
    getChapterVideoTree(courseId) {
        return request({
            url: `/eduservice/chapter/tree/${courseId}`,
            method: 'get',
        })
    },

    addChapter(eduChapter) {
        return request({
            url: `/eduservice/chapter/`,
            method: 'post',
            data : eduChapter
        })
    },
    getChapter(id) {
        return request({
            url: `/eduservice/chapter/${id}`,
            method: 'get',
        })
    },
    removeChapter(id) {
        return request({
            url: `/eduservice/chapter/${id}`,
            method: 'delete',
        })
    },
    updateChapter(eduChapter) {
        return request({
            url: `/eduservice/chapter/${eduChapter.id}`,
            method: 'put',
            data : eduChapter
        })
    },

}

